import React,{Component,PropTypes} from 'react';
import Baselist from 'components/Baselist';
import Crumb from 'components/Crumb'
import {redirect,backward} from 'lib/utils';
import API, {} from 'lib/api';


import CommonInfo from './../CommonInfo';
import PhotoAlbum from './../PhotoAlbum';
import Standard from './../Standard';
import Describe from './../Describe';
import Attribute from './../Attribute';

import {Card,Tabs} from 'antd';
import './style.less';

const TabPane = Tabs.TabPane;

export default class Add extends Component{
    constructor(props){
        super(props);

        this.state={

            crumb:[
                {href:"/",title:"首页"},
                {href:"/",title:"商品管理"}
            ]
        }
    };

    // tab页 回调
    callback = (key) => {
        // console.log(key);
    }


    componentDidMount(){

    };



    render(){
        const {id} = this.state;
        return(
            <Baselist>
                <Crumb crumb={this.state.crumb}/>
                <Card title=""  className="" noHovering={true} >
                    <Tabs defaultActiveKey="1" onChange={this.callback} type="card">
                        <TabPane tab="通用信息" key="1">
                            <CommonInfo id={this.props.routeParams.id}/>
                        </TabPane>

                        <TabPane tab="商品相册" key="2">
                            <PhotoAlbum id={this.props.routeParams.id}/>
                        </TabPane>

                        <TabPane tab="商品规格" key="3">
                            <Standard id={this.props.routeParams.id}/>
                        </TabPane>


                        <TabPane tab="商品属性" key="4">
                            <Attribute id={this.props.routeParams.id}/>
                        </TabPane>


                        <TabPane tab="商品详情" key="5">
                            <Describe id={this.props.routeParams.id}/>
                        </TabPane>
                    </Tabs>
                </Card>
            </Baselist>
        )
    }
};
